package com.dslu.fx.service.impl;

import com.dslu.fx.dao.EmergencyDepartDao;
import com.dslu.fx.domain.CarDO;
import com.dslu.fx.domain.EmergencyDO;
import com.dslu.fx.domain.EmergencyDepartDO;
import com.dslu.fx.service.EmergencyDepartService;
import com.dslu.fx.vo.EmergencyStockVO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;



@Service
public class EmergencyDepartServiceImpl implements EmergencyDepartService {
	@Autowired
	private EmergencyDepartDao emergencyDepartDao;
	
	@Override
	public EmergencyDepartDO get(Integer id){
		return emergencyDepartDao.get(id);
	}
	
	@Override
	public List<EmergencyDepartDO> list(Map<String, Object> map){
		return emergencyDepartDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return emergencyDepartDao.count(map);
	}
	
	@Override
	public int save(EmergencyDepartDO emergencyDepart){
		return emergencyDepartDao.save(emergencyDepart);
	}
	
	@Override
	public int update(EmergencyDepartDO emergencyDepart){
		return emergencyDepartDao.update(emergencyDepart);
	}
	
	@Override
	public int remove(Integer id){
		return emergencyDepartDao.remove(id);
	}
	
	@Override
	public int batchRemove(Integer[] ids){
		return emergencyDepartDao.batchRemove(ids);
	}

    @Override
    public PageInfo<EmergencyDepartDO> getEmergencyDepartList(Map<String, Object> map) {
        PageHelper.startPage(map); //开始起始页
        List<EmergencyDepartDO> list = emergencyDepartDao.getEmergencyDepartList(map); // 获取数据
        PageInfo<EmergencyDepartDO> page = new PageInfo<>(list); // 实例化PageInfo
        return page;
    }

    @Override
    public EmergencyDepartDO getOne(Map<String, Object> map){
        return emergencyDepartDao.getOne(map);
    }

	@Override
	public EmergencyDO getEmergencyByBatchNo(String batchNo) {
		return emergencyDepartDao.getEmergencyByBatchNo(batchNo);
	}

	@Override
	public List<EmergencyStockVO> getEmergencyTemplateStockList(Map<String, Object> map) {
		return emergencyDepartDao.getEmergencyTemplateStockList(map);
	}

	@Override
	public List<EmergencyStockVO> getEmergencyStockVOList(Map<String, Object> map) {
		return emergencyDepartDao.getEmergencyStockVOList(map);
	}

	@Override
	public List<CarDO> getTemplateCarList(Map<String, Object> map) {
		return emergencyDepartDao.getTemplateCarList(map);
	}

	@Override
	public List<CarDO> getCarList(Map<String, Object> map) {
		return emergencyDepartDao.getCarList(map);
	}

	@Override
	public EmergencyDO getEmergencyById(int id) {
		return emergencyDepartDao.getEmergencyById(id);
	}

}
